<?php

class MenuTypes {

    private $_name;

    public function getName() {
        return $this->_name;
    }

    public function setName($name) {
        $this->_name = $name;
    }

    public function getList($db = null) {
        if ($db != null) {
            $sql = "SELECT
                        `MT_Name`
                      FROM `menu_types`";

            $parameters = null;
            $values = null;
            $types = null;
            $result = $db->executeQuery($sql, $parameters, $values, $types);

            if ($result != null) {
                $rows = array();
                while ($row = $result->fetch()) {

                    $menuType = new MenuTypes();
                    $menuType->setName($row->MT_Name);
                    $rows[] = $menuType;
                }
                return $rows;
            } else {
                return null;
            }
        }
    }

}

?>
